package com.xxx.service.impl;

import com.xxx.service.FileService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.io.File;

@Service
public class FileServiceImpl implements FileService {

    @Value("${file.path}")
    private String filePath;


    @Value("${image.path}")
    private String imagePath;

    @Override
    public boolean delFile(String fileName) {

        File file = new File(filePath + fileName);

        return file.delete();

    }

    @Override
    public boolean delImage(String imageName) {
        File file = new File(imagePath + imageName);
        return file.delete();
    }
}
